package com.bilubi.reggie.reggie.mapper;

import com.bilubi.reggie.reggie.annotation.AutoFill;
import com.bilubi.reggie.reggie.bean.ShoppingCart;
import com.bilubi.reggie.reggie.bean.User;
import com.bilubi.reggie.reggie.enums.OperateType;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ShoppingCartMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ShoppingCart record);

    @AutoFill(value = OperateType.USERID)
    int insertSelective(ShoppingCart record);

    ShoppingCart selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ShoppingCart record);

    int updateByPrimaryKey(ShoppingCart record);

    List<ShoppingCart> selectByUserId(Long userId);

    @AutoFill(value = OperateType.USERID)
    int deleteByUserId(ShoppingCart record);

    @AutoFill(value = OperateType.USERID)
    Integer updateByUserIdAndItemId(ShoppingCart record);

    @AutoFill(value = OperateType.USERID)
    ShoppingCart selectByUserIdAndItemId(ShoppingCart shoppingCart);

    int deleteByUserItemId(ShoppingCart shoppingCart);
}